{% extends "cashflow/base.html" %}
{% load i18n %}


{% block nav %}
  {% include "cashflow/nav.html" %}
{% endblock %}

{% block subnav %}
{% endblock %}

{% block toolbar %}
Transaction History
{% endblock %}


{% block content %}

<h2>{% trans "History" %}</h2>

Filter: 
<form method="POST">
{% csrf_token %}
	<table>{{ form }}</table>
	<input type="submit" value="{% trans "Apply" %}">
</form>

<table class="data">
	<tr>
		<th> </th>
		<th>{% trans "Date" %}</th>
		<th>{% trans "Credit" %}</th>
		<th>{% trans "Debit" %}</th>
		<th>{% trans "Balance" %}</th>
		<th>{% trans "Tag" %}</th>
		<th>{% trans "Description" %}</th>
	</tr>
{% for item in history %}
	<tr>
		<td>
			{% if item.credit %}
				<img src="{{MEDIA_URL}}img/money_add.png">
			{% else %}
				<img src="{{MEDIA_URL}}img/money_delete.png">
			{% endif%}
		</td>
		<td>
			{{item.datetime}}
		</td>
		<td>
			{{item.credit}}
		</td>
		<td>
			{{item.debit}}
		</td>
		<td>
			{{item.balance}}({{item.balance_before}})
		</td>
		<td>
			{{item.tag}}
		</td>
		<td>
			{{item.description}}
		</td>
	</tr>
{% endfor %}
</table>

{% endblock %}